#ifndef __BASE_MODEL_H__
#define __BASE_MODEL_H__

#include <string>
#include <vector>

namespace Nezha
{
	//	Mesh
	struct Mesh
	{
		int mMaterialIndex;
		std::vector<int> mTriangleIndices;
	};

	//	Material properties
	struct Material
	{
		float mAmbient[4], mDiffuse[4], mSpecular[4], mEmissive[4];
		float mShininess;
		unsigned int mTextureID;
		std::string mTextureFilename;
	};

	//	Triangle structure
	struct Triangle
	{
		float mVertexNormals[3][3];
		float mS[3], mT[3];
		int mVertexIndices[3];
	};

	//	Vertex structure
	struct Vertex
	{
		char mBoneID;	// for skeletal animation
		float mLocation[3];
	};

	class TriangleListMesh;
	struct BaseModel
	{
	public:
		typedef std::vector<Triangle> TriangleArray;
		typedef std::vector<Material> MaterialArray; 
		typedef std::vector<Vertex> VertexArray;
		typedef std::vector<Mesh> MeshArray;

	public:
		virtual TriangleListMesh* loadModelData( const char* filename ) = 0;

	protected:
		//	Meshes used
		MeshArray mMeshes;

		//	Materials used
		MaterialArray mMaterials;

		//	Triangles used
		TriangleArray mTriangles;

		//	Vertices Used
		VertexArray mVertices;
	};
}

#endif // ndef MODEL_H
